<html>
<head><meta charset="utf-8"><title>extending `Binder` in rustc to include # of bound variables · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html">extending `Binder` in rustc to include # of bound variables</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="199411266"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199411266" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199411266">(Jun 01 2020 at 19:19)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> so I started working on this a little bit</p>



<a name="199411287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199411287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199411287">(Jun 01 2020 at 19:19)</a>:</h4>
<p>I basically just started by adding a <code>u32</code> to <code>Binder</code> alongside <code>T</code></p>



<a name="199411380"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199411380" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199411380">(Jun 01 2020 at 19:20)</a>:</h4>
<p>Was wondering if it's worth just doing a perf run with this alone since it changes the size of types</p>



<a name="199411544"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199411544" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199411544">(Jun 01 2020 at 19:21)</a>:</h4>
<p>Also, right now I'm just assuming that we can only have lifetimes</p>



<a name="199411659"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199411659" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199411659">(Jun 01 2020 at 19:22)</a>:</h4>
<p>The next step would be to actually count the number of bound variables in <code>Binder::bind</code></p>



<a name="199532264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199532264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199532264">(Jun 02 2020 at 18:19)</a>:</h4>
<p>So when I actually started counting the bound vars, I get two test failures</p>



<a name="199532270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199532270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199532270">(Jun 02 2020 at 18:19)</a>:</h4>
<p><code>ui/consts/const-eval/issue-70804-fn-subtyping.rs</code></p>



<a name="199532287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199532287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199532287">(Jun 02 2020 at 18:19)</a>:</h4>
<p>and <code>ui/issues/issue-23611-enum-swap-in-drop.rs</code></p>



<a name="199532320"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199532320" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199532320">(Jun 02 2020 at 18:19)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error: internal compiler error: src/librustc_mir/interpret/place.rs:839: type mismatch when copying!
src: (for&lt;&#39;r&gt; fn(&amp;&#39;r ()), std::string::String),
dest: (fn(&amp;()), std::string::String)
</code></pre></div>



<a name="199532436"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199532436" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199532436">(Jun 02 2020 at 18:20)</a>:</h4>
<div class="codehilite"><pre><span></span><code>error: internal compiler error: src/librustc_mir/interpret/place.rs:839: type mismatch when copying!
src: for&lt;&#39;r, &#39;s&gt; fn(u32, &amp;&#39;r str, &amp;&#39;s std::cell::RefCell&lt;std::vec::Vec&lt;u32&gt;&gt;),
dest: for&lt;&#39;r&gt; fn(u32, &amp;&#39;r str, &amp;std::cell::RefCell&lt;std::vec::Vec&lt;u32&gt;&gt;)
</code></pre></div>



<a name="199532959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199532959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199532959">(Jun 02 2020 at 18:23)</a>:</h4>
<p>So, I'm pretty sure this is a bug</p>



<a name="199533053"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199533053" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199533053">(Jun 02 2020 at 18:24)</a>:</h4>
<p>That's erroring at <code>copy_no_op_validate</code></p>



<a name="199533076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199533076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199533076">(Jun 02 2020 at 18:24)</a>:</h4>
<p>The doc comment says</p>
<div class="codehilite"><pre><span></span><code>    /// Copies the data from an operand to a place. This does not support transmuting!
    /// Use `copy_op_transmute` if the layouts could disagree.
</code></pre></div>



<a name="199533105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199533105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199533105">(Jun 02 2020 at 18:24)</a>:</h4>
<p>And this is definitely a transmute</p>



<a name="199533130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199533130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199533130">(Jun 02 2020 at 18:25)</a>:</h4>
<p>Right?</p>



<a name="199533157"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199533157" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199533157">(Jun 02 2020 at 18:25)</a>:</h4>
<p>Like, they aren't the same type</p>



<a name="199533199"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199533199" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199533199">(Jun 02 2020 at 18:25)</a>:</h4>
<p>Though, <em>can</em> be safely transmutated?</p>



<a name="199534228"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199534228" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199534228">(Jun 02 2020 at 18:33)</a>:</h4>
<p>wait no, it's not a transmute because the layout is the same</p>



<a name="199543777"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199543777" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199543777">(Jun 02 2020 at 19:50)</a>:</h4>
<p>seems like it's probably a bug</p>



<a name="199543787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199543787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199543787">(Jun 02 2020 at 19:50)</a>:</h4>
<p>but where the bug is...</p>



<a name="199543801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199543801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199543801">(Jun 02 2020 at 19:50)</a>:</h4>
<p>it's eh</p>



<a name="199543806"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199543806" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199543806">(Jun 02 2020 at 19:50)</a>:</h4>
<p>not really a bug</p>



<a name="199543815"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199543815" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199543815">(Jun 02 2020 at 19:51)</a>:</h4>
<p>but an implementation detail</p>



<a name="199543834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199543834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199543834">(Jun 02 2020 at 19:51)</a>:</h4>
<p>an <code>eval_context</code></p>



<a name="199543860"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199543860" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199543860">(Jun 02 2020 at 19:51)</a>:</h4>
<p><code>mir_assign_valid_types</code> "normalizes" the src and dest types</p>



<a name="199543878"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199543878" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199543878">(Jun 02 2020 at 19:51)</a>:</h4>
<p>for regions, it erases them</p>



<a name="199543898"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199543898" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199543898">(Jun 02 2020 at 19:51)</a>:</h4>
<p>but the <code>Binder</code> doesn't keep track of this</p>



<a name="199543999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199543999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199543999">(Jun 02 2020 at 19:52)</a>:</h4>
<p>(if I change the <code>TypeFoldable</code> impl for <code>Binder</code> to always recalculate the bound vars, it works fine</p>



<a name="199544006"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199544006" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199544006">(Jun 02 2020 at 19:52)</a>:</h4>
<p>This really isn't ideal though</p>



<a name="199544089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199544089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199544089">(Jun 02 2020 at 19:53)</a>:</h4>
<p>I'm a bit confused but ok :)</p>



<a name="199544099"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199544099" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199544099">(Jun 02 2020 at 19:53)</a>:</h4>
<p>I'd have to read I guess into the code a bit more</p>



<a name="199544129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199544129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199544129">(Jun 02 2020 at 19:53)</a>:</h4>
<p>I'm thinking I might make a WIP PR</p>



<a name="199544182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199544182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199544182">(Jun 02 2020 at 19:54)</a>:</h4>
<p>just so I can see just how bad of a perf drop this is so far</p>



<a name="199544191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199544191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199544191">(Jun 02 2020 at 19:54)</a>:</h4>
<p>I'm still -- tbqh -- debating whether counting is good</p>



<a name="199544202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199544202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199544202">(Jun 02 2020 at 19:54)</a>:</h4>
<p>I guess we could try to <em>also</em> modify chalk to not count</p>



<a name="199544212"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199544212" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199544212">(Jun 02 2020 at 19:54)</a>:</h4>
<p>And see what gets harder</p>



<a name="199544240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199544240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199544240">(Jun 02 2020 at 19:54)</a>:</h4>
<p>It would also mean not having a "array" of kinds and things</p>



<a name="199544264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199544264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199544264">(Jun 02 2020 at 19:54)</a>:</h4>
<p>you'd have to walk the bound contents and infer it</p>



<a name="199544276"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199544276" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199544276">(Jun 02 2020 at 19:54)</a>:</h4>
<p>and there are things that can't be expressed, which is ungreat</p>



<a name="199544296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199544296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199544296">(Jun 02 2020 at 19:55)</a>:</h4>
<p>e.g., <code>for&lt;'a&gt; u32</code></p>



<a name="199544341"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199544341" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199544341">(Jun 02 2020 at 19:55)</a>:</h4>
<p>I feel like this comes up in Rust sometimes - I guess there may even be a backwards compatibility concern there</p>



<a name="199544363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199544363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199544363">(Jun 02 2020 at 19:55)</a>:</h4>
<p>e.g., <code>for&lt;'a&gt; fn(&amp;'static u32)</code> and <code>fn(&amp;'static u32)</code> are both represented same way in compiler presumably</p>



<a name="199544589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199544589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199544589">(Jun 02 2020 at 19:57)</a>:</h4>
<p>Well</p>



<a name="199544600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/extending%20%60Binder%60%20in%20rustc%20to%20include%20%23%20of%20bound%20variables/near/199544600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/extending.20.60Binder.60.20in.20rustc.20to.20include.20.23.20of.20bound.20variables.html#199544600">(Jun 02 2020 at 19:57)</a>:</h4>
<p>probably</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>